package breeze.tool.life.services;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import breeze.tool.life.R;
import android.os.Binder;
import breeze.tool.life.module.WeatherNowBean;
import breeze.tool.life.utils.AppWeatherUtils;
import brz.breeze.app_utils.BAppUtils;
import brz.breeze.tool_utils.Blog;
import java.text.SimpleDateFormat;
import breeze.tool.life.module.Weather3DBean;

public class WeatherUpdateServics extends Service {
    /*
	*@author BREEZE
	*@date 2021-11-28 10:44:11
    */

    public static final String TAG = "WeatherUpdateServics";
    
	private Blog log;
	
	
    @Override
    public IBinder onBind(Intent intent) {
        
        return new MBinder();
    }
	
	@Override
	public void onCreate() {
		log = new Blog(this);
		super.onCreate();
	}
	
	public WeatherNowBean getBean(){
		log.i(TAG,"update weather data ".concat(new SimpleDateFormat("HH:mm:ss").format(System.currentTimeMillis())));
		return AppWeatherUtils.getWeatherNow();
	}
	
	public Weather3DBean get3DBean(){
		log.i(TAG,"update 3days weather data ".concat(new SimpleDateFormat("HH:mm:ss").format(System.currentTimeMillis())));
		return AppWeatherUtils.getWeather3DBean();
	}
	
	public class MBinder extends Binder{
		public WeatherUpdateServics getService(){
			return WeatherUpdateServics.this;
		}
	}
    
}
